package com.minimalist.common.feign.client.lindi;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.lindi.vo.purchaseindexrecord.LindiPurchaseIndexRecordQueryVO;
import com.minimalist.common.entity.lindi.vo.purchaseindexrecord.LindiPurchaseIndexRecordVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.lindi.LindiPurchaseIndexRecordFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 林地指标交易平台_购买指标记录 Feign 客户端
 *
 * @author 11987
 */
@FeignClient(name = "minimalist-lindi"
        , contextId = "lindiPurchaseIndexRecordFeignClient"
        , path = "/minimalist/lindi/purchaseIndexRecord"
        , configuration = FeignConfig.class
        , fallbackFactory = LindiPurchaseIndexRecordFeignClientFallbackFactory.class)
public interface LindiPurchaseIndexRecordFeignClient{
    /**
     * 添加购买指标记录
     *
     * @param purchaseIndexRecordVO 购买指标记录信息
     * @return 成功或失败
     */
    @PostMapping("/addPurchaseIndexRecord")
    @Operation(summary = "添加购买指标记录")
    R<?> addPurchaseIndexRecord(
            @RequestBody @Validated(Add.class)
            LindiPurchaseIndexRecordVO purchaseIndexRecordVO);

    /**
     * 删除购买指标记录 -> 根据购买指标记录ID删除
     *
     * @param purchaseIndexRecordId 购买指标记录ID
     * @return 成功或失败
     */
    @DeleteMapping("/deletePurchaseIndexRecordByPurchaseIndexRecordId")
    @Operation(summary = "删除购买指标记录 -> 根据购买指标记录ID删除")
    R<?> deletePurchaseIndexRecordByPurchaseIndexRecordId(
            @RequestParam("purchaseIndexRecordId")
            @NotNull(message = "购买指标记录ID不能为空")
            @Parameter(name = "purchaseIndexRecordId", required = true, description = "购买指标记录ID")
            Long purchaseIndexRecordId);

    /**
     * 修改购买指标记录
     *
     * @param purchaseIndexRecordVO 购买指标记录信息
     * @return 成功或失败
     */
    @PutMapping("/updatePurchaseIndexRecordByPurchaseIndexRecordId")
    @Operation(summary = "修改购买指标记录")
    R<?> updatePurchaseIndexRecordByPurchaseIndexRecordId(
            @RequestBody @Validated(Update.class)
            LindiPurchaseIndexRecordVO purchaseIndexRecordVO);

    /**
     * 查询购买指标记录列表(分页)
     *
     * @param queryVO 查询条件
     * @return 购买指标记录列表
     */
    @GetMapping("/getPagePurchaseIndexRecordList")
    @Operation(summary = "查询购买指标记录列表(分页)")
    R<PageResp<LindiPurchaseIndexRecordVO>> getPagePurchaseIndexRecordList(
            @RequestBody LindiPurchaseIndexRecordQueryVO queryVO);

    /**
     * 根据购买指标记录ID查询购买指标记录
     *
     * @param purchaseIndexRecordId 购买指标记录ID
     * @return 购买指标记录
     */
    @GetMapping("/getPurchaseIndexRecordByPurchaseIndexRecordId/{purchaseIndexRecordId}")
    @Operation(summary = "根据购买指标记录ID查询购买指标记录")
    R<LindiPurchaseIndexRecordVO> getPurchaseIndexRecordByPurchaseIndexRecordId(
            @PathVariable(value = "purchaseIndexRecordId")
            @NotNull(message = "购买指标记录ID不能为空")
            @Parameter(name = "purchaseIndexRecordId", description = "购买指标记录ID", required = true)
            Long purchaseIndexRecordId);

    /**
     * 删除购买指标记录文件 -> 根据文件ID删除
     *
     * @param fileId 文件ID
     * @return 成功或失败
     */
    @PostMapping("/deletePurchaseIndexRecordFileByFileId")
    @Operation(summary = "删除购买指标记录文件 -> 根据文件ID删除")
    R<?> deletePurchaseIndexRecordFileByFileId(
            @RequestParam("fileId")
            @NotNull(message = "文件ID不能为空")
            @Parameter(name = "fileId", description = "文件ID", required = true)
            Long fileId);
}